Skip to content

test(discovery): render the per-run scorecard - #66

Closed
pengyuzhang wants to merge 1 commit into
pr/09-faultcheckfrom
pr/10-report
Closed

test(discovery): render the per-run scorecard#66
pengyuzhang wants to merge 1 commit into
pr/09-faultcheckfrom
pr/10-report

Conversation

@pengyuzhang

Copy link
Copy Markdown
Collaborator

Stacked on #65.

One HTML page per run, written next to score.json.

The rows are the product, not the numbers

The aggregate is for trend tracking. Every false positive and false negative is listed individually by manifest id, with the evidence the collector recorded — probe, channel, path, and the rule that fired.

That last field is what turns a false positive into a bug report. The snapshot already names why each asset was believed; a reader should not have to open two JSON files side by side to find it.

The page also carries what an aggregate cannot: the baseline asset count, per-field accuracy with the specific entries that were wrong, the excluded entries and why each left the denominator, the canary verdict, and the review-queue result.

Self-contained by construction

One file, no external assets, no network, no script tags. A scorecard that needed a CDN would be unreadable on the isolated host that produced it. It renders in light and dark.

Two things it must not do

Render what it was handed. Everything is escaped; a test feeds it <img src=x onerror=...> as a run id.

Leak a canary. A test walks every planted value and asserts none reaches the page. A value redacted out of the snapshot and copied into a document that then gets shared has still left the machine.

Verification

$ python3 -m unittest discover -s tests -t . -q
Ran 66 tests in 0.045s
OK

One page per run. The aggregate number is for tracking; the individual rows are
what somebody fixes, so every false positive and every false negative is listed
by manifest id with the evidence the collector recorded.

That evidence is the point. The snapshot names the probe, the channel, the path
and the rule that fired for each asset, which means a miss can be localized to
a probe from the output alone - and a reader should not have to open two JSON
files side by side to find that out.

Self-contained by construction: one file, no external assets, no network. A
scorecard that needed a CDN would be unreadable on the isolated host that
produced it. Everything it is handed is escaped, and a test asserts no planted
canary value can reach the page - a value redacted out of the snapshot and
copied into the report has still left the machine.
@pengyuzhang
pengyuzhang deleted the pr/10-report branch August 23, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants